JpegRawOrganizer-0.1.0.0: Short description of your package

Safe HaskellSafe
LanguageHaskell2010

Cmd

Description

The module to handle all comands entered at the console. Info: For simplicitie's sake the files matching the rawEnding of the settings are calleds raw files and the files matching the jpegEnding are called jpeg files even they could have any ending and could be files of any type.

Synopsis

Documentation

cmdMain :: IO () Source #

Starts to listen for commands on the console.

inputHandler Source #

Arguments

:: (PhotoSetting, String)

Tuple containing the current settings of the program and an input string.

-> IO ()

An empty io monade.

Handles the user input by reading a line from the console recursively.

handleCommand Source #

Arguments

:: (String, String)

Tupel containing the command and its optional arguments.

-> PhotoSetting

The current settings of the program.

-> IO (PhotoSetting, String)

Tupel of the maybe changed settings and a message about the action performed.

Takes the command the user entered and does some action depeding on it.

toTuple Source #

Arguments

:: String

The string the user write on the console.

-> (String, String)

Tuple of the command identifier and it optional arguments (maybe an empty string)

Takes the user input string and split it at the first blank character into the command and its optional argument. If the entered command has no argument the argument string is empty.

stringToBool Source #

Arguments

:: String

The string to be parsed.

-> Bool

The string parsed to an boolean.

Parses a string to a boolean. Accepted are "True" and "true" all other string result in False.

uniformFilePath Source #

Arguments

:: String

The file path to be uniformed as a string.

-> String

The uniformed file path as a string.

Brings a given file path to an universal format by replacing backslash with slash and adding a slash at the end of the path if there is no one. If the given file path is an empty string the relativ path of the program "./" is returned.

uniformFileExtension Source #

Arguments

:: String

The extension to be uniformed as a string.

-> String

The uniformed extension as a string.

Brings a given file extension to an universal format by replacing adding a dot at the beginning if there is no one. If the given extension is an empty string ".*" is returned.

formatPhotoFileList Source #

Arguments

:: [PhotoFile]

The list of photo files that should be formatted as a string.

-> String

The string listing all given photo files well formatted.

Takes a list of PhotoFiles and returns a string listing all files well formatted.